package org.shoukaiseki.supersaiyan.common.core.domain.entity;


import java.util.Date;
import com.alibaba.fastjson2.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.ibatis.type.Alias;
import org.shoukaiseki.supersaiyan.common.core.domain.base.BaseEntity;

/**
 * 用户信息 对象 sys_userEntity
 *
 * @author shoukaiseki
 * @date 2022-10-07
 */
@Alias("SysUserEntity")
public class SysUserEntity extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    public static final String TABLE_NAME = "sys_user";

    //主键名
    public static final String TABLE_UNIQUE_ID_NAME = "user_id";

    /** 用户ID */
    private Long userId;

    /** 用户账号 */
    private String userName;

    /** 用户昵称 */
    private String nickName;

    /** 用户类型 */
    private String userType;

    /** 用户邮箱 */
    private String email;

    /** 手机号码 */
    private String phonenumber;

    /** 用户性别（0男 1女 2未知） */
    private String sex;

    /** 头像地址 */
    private String avatar;

    /** 密码 */
    private String password;

    /** 最后登录IP */
    private String loginIp;

    /** 最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format="yyyy-MM-dd HH:mm:ss")
    private Date loginDate;

    /** 状态 */
    private Integer status;

    /** 拥有所有组织权限 */
    private Integer allOrgFlag;

    /** 拥有所有地点权限 */
    private Integer allSiteFlag;

    /** 默认地点 */
    private Long defSiteId;

    /** 默认组织 */
    private Long defOrgId;

    /** 地点 */
    private Long siteId;

    /** 组织 */
    private Long orgId;

    /** 部门 */
    private Long deptId;

    /** 创建人员 */
    private Long createUserId;

    /** 更新人员 */
    private Long updateUserId;

    /** 删除标志 */
    private Integer delFlag;

    /** 行标记 */
    private Long rowstamp;

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }
    public void setUserName(String userName)
    {
        this.userName = userName;
    }

    public String getUserName()
    {
        return userName;
    }
    public void setNickName(String nickName)
    {
        this.nickName = nickName;
    }

    public String getNickName()
    {
        return nickName;
    }
    public void setUserType(String userType)
    {
        this.userType = userType;
    }

    public String getUserType()
    {
        return userType;
    }
    public void setEmail(String email)
    {
        this.email = email;
    }

    public String getEmail()
    {
        return email;
    }
    public void setPhonenumber(String phonenumber)
    {
        this.phonenumber = phonenumber;
    }

    public String getPhonenumber()
    {
        return phonenumber;
    }
    public void setSex(String sex)
    {
        this.sex = sex;
    }

    public String getSex()
    {
        return sex;
    }
    public void setAvatar(String avatar)
    {
        this.avatar = avatar;
    }

    public String getAvatar()
    {
        return avatar;
    }
    public void setPassword(String password)
    {
        this.password = password;
    }

    public String getPassword()
    {
        return password;
    }
    public void setLoginIp(String loginIp)
    {
        this.loginIp = loginIp;
    }

    public String getLoginIp()
    {
        return loginIp;
    }
    public void setLoginDate(Date loginDate)
    {
        this.loginDate = loginDate;
    }

    public Date getLoginDate()
    {
        return loginDate;
    }
    public void setStatus(Integer status)
    {
        this.status = status;
    }

    public Integer getStatus()
    {
        return status;
    }
    public void setAllOrgFlag(Integer allOrgFlag)
    {
        this.allOrgFlag = allOrgFlag;
    }

    public Integer getAllOrgFlag()
    {
        return allOrgFlag;
    }
    public void setAllSiteFlag(Integer allSiteFlag)
    {
        this.allSiteFlag = allSiteFlag;
    }

    public Integer getAllSiteFlag()
    {
        return allSiteFlag;
    }
    public void setDefSiteId(Long defSiteId)
    {
        this.defSiteId = defSiteId;
    }

    public Long getDefSiteId()
    {
        return defSiteId;
    }
    public void setDefOrgId(Long defOrgId)
    {
        this.defOrgId = defOrgId;
    }

    public Long getDefOrgId()
    {
        return defOrgId;
    }
    public void setSiteId(Long siteId)
    {
        this.siteId = siteId;
    }

    public Long getSiteId()
    {
        return siteId;
    }
    public void setOrgId(Long orgId)
    {
        this.orgId = orgId;
    }

    public Long getOrgId()
    {
        return orgId;
    }
    public void setDeptId(Long deptId)
    {
        this.deptId = deptId;
    }

    public Long getDeptId()
    {
        return deptId;
    }
    public void setCreateUserId(Long createUserId)
    {
        this.createUserId = createUserId;
    }

    public Long getCreateUserId()
    {
        return createUserId;
    }
    public void setUpdateUserId(Long updateUserId)
    {
        this.updateUserId = updateUserId;
    }

    public Long getUpdateUserId()
    {
        return updateUserId;
    }
    public void setDelFlag(Integer delFlag)
    {
        this.delFlag = delFlag;
    }

    public Integer getDelFlag()
    {
        return delFlag;
    }
    public void setRowstamp(Long rowstamp)
    {
        this.rowstamp = rowstamp;
    }

    public Long getRowstamp()
    {
        return rowstamp;
    }

    public ToStringBuilder toStringBuilder(){
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("userId", getUserId())
                .append("userName", getUserName())
                .append("nickName", getNickName())
                .append("userType", getUserType())
                .append("email", getEmail())
                .append("phonenumber", getPhonenumber())
                .append("sex", getSex())
                .append("avatar", getAvatar())
                .append("password", getPassword())
                .append("loginIp", getLoginIp())
                .append("loginDate", getLoginDate())
                .append("remark", getRemark())
                .append("status", getStatus())
                .append("allOrgFlag", getAllOrgFlag())
                .append("allSiteFlag", getAllSiteFlag())
                .append("defSiteId", getDefSiteId())
                .append("defOrgId", getDefOrgId())
                .append("siteId", getSiteId())
                .append("orgId", getOrgId())
                .append("deptId", getDeptId())
                .append("createUserId", getCreateUserId())
                .append("createTime", getCreateTime())
                .append("updateUserId", getUpdateUserId())
                .append("updateTime", getUpdateTime())
                .append("delFlag", getDelFlag())
                .append("rowstamp", getRowstamp())
                .append("createBy", this.getCreateUserId())
                .append("updateBy", this.getUpdateUserId())
                ;
    }


    @Override
    public String toString() {
        return toStringBuilder().toString();
    }


}
